package cmd

import (
	"ginchat/apis"
	"ginchat/internal/globals"
	"ginchat/utils/errorx"
	"ginchat/utils/message"

	"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
	Use: "gin-chat project",
	Run: func(cmd *cobra.Command, args []string) {
		message.Println("service starting...")
		wg := globals.GetWaitGroup()
		wg.Add(1)
		go apis.StartHttp()
	},
}

func Execute() {
	errorx.ErrorExit(rootCmd.Execute())
}
